import java.util.*;
public class chap1{
	public static void main(String args[]){
		int a[][]={
			{1,1,1,1,1},
			{2,2,2,2,2},
			{3,3,3,3,3}
		};
		int b[][]={
			{4,4,4,4,4},
			{5,5,5,5,5},
			{6,6,6,6,6}
		};
		int c[][]=new int[3][5];
		int d[][]=new int[3][5];
		for (int i=0;i<3 ;i++ ) {
			for (int j=0;j<5 ;j++ ) {
				c[i][j]=a[i][j]+b[i][j];
				d[i][j]=a[i][j]*b[i][j];
			}
		}
		for (int i=0;i<3 ;i++ ) {
			for (int j=0;j<5 ;j++ ) {
				System.out.print(c[i][j]+" ");
			}
			System.out.println();
		}
		System.out.println();
		for (int i=0;i<3 ;i++ ) {
			for (int j=0;j<5 ;j++ ) {
				System.out.print(d[i][j]+" ");
			}
			System.out.println();
		}
	}
}